{% extends "base.html" %}

{% block post_meta %}
<p>Author<span>{{ post.author }}</span></p>
<p>Date<span>{{ post.update }}</span></p>
{% if post.postrate != 0 %}
<p>
	<ul class="rating" id="postrating">	<!-- add class of rateX in javascript -->
		<li class="one">1</li>
		<li class="two">2</li>
		<li class="three">3</li>
		<li class="four">4</li>
		<li class="five">5</li>
		<input type="hidden" id="postrate" value="{{ post.postrate }}" />
	</ul>
</p>
{% endif %}
<p><g:plusone annotation="none"></g:plusone></p>
{% endblock %}

{% block post_content %}
<h2>{{ post.title }}</h2>
<p id="post_content">{{ post.content }}</p>
{% endblock %}

{% block comments_div %}
{% if comments|length == 0 %}
<p>No one have left comment. Be the first!</p>
{% endif %}
{% for comment in comments %}
<li>
	<div class="comment_box">
		<div class="comment_author">
			{{ comment.user }}
			<span class="comment_time">{{ comment.time }}</span>
{% if comment.rate != 0 %}
			<span class="comment_rate">
				<ul class="rating rate{{comment.rate}}">
					<li class="one">1</li>
					<li class="two">2</li>
					<li class="three">3</li>
					<li class="four">4</li>
					<li class="five">5</li>
				</ul>
			</span>
{% endif %}
		</div>
		<p>{{ comment.content }}</p>
	</div>
</li>
{% endfor %}
{% endblock %}

{% block comment_form %}
<form action="" method="post">
    <div class="form_row">
	    <label>Name</label><br />
	    <input type="text" id="user" />
    </div>
    <div class="form_row">
    	<label>Rate:</label>
    	<ul class="rating rate0" id="ratePost">
			<li class="one"><a href="#" title="2">1</a></li>
			<li class="two"><a href="#" title="4">2</a></li>
			<li class="three"><a href="#" title="6">3</a></li>
			<li class="four"><a href="#" title="8">4</a></li>
			<li class="five"><a href="#" title="10">5</a></li>
		</ul>
		<input type="hidden" id="rate_form" value="0" />
	</div>
    <div class="form_row">
	    <label>Comment</label><br />
	    <textarea id="comment_content" rows="" cols=""></textarea>
    </div>
    <input type="hidden" id="postID" value="{{ post.id }}" />
    <input type="button" value="Submit" id="comment_submit" class="submit_btn" />
    <span id="comment_error"></span>
</form>
{% endblock %}
